package com.relytosoft.mizar.analyze.system.services.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.relytosoft.dubhe.common.core.base.page.PageQuery;
import com.relytosoft.mizar.analyze.system.api.entity.AyVehicleGroup;

import java.util.List;

/**
 * @author lj
 * @date 2022/5/12 10:16
 */
public interface AyVehicleGroupService extends IService<AyVehicleGroup> {

    IPage<AyVehicleGroup> selectAyVehicleGroupPageList(PageQuery pageQuery, AyVehicleGroup ayVehicleGroup);

    List<AyVehicleGroup> selectAyVehicleGroupList(AyVehicleGroup ayVehicleGroup);

    /**
     * 根据车ID查询改车关联的的库ID
     *
     * @param vehicleId 车ID
     * @return 组ID
     */
    List<Integer> selectByVehicleId(Integer vehicleId);

    /**
     * 根据车辆id和库id删除更改后的关系表
     *
     * @param id        车辆id
     * @param oldGroups 库id
     */
    boolean selectByVehicleIdAndGroupIds(Integer id, List<Integer> oldGroups);


    /**
     * 根据车ID和组ID判断是否存在
     *
     * @param vehicleId 车ID
     * @param groupId   组ID
     * @return AyVehicleGroup
     */
    AyVehicleGroup selectVehicleIdAndGroupId(Integer vehicleId, Integer groupId);

}
